package test.zuche;

public class KeCar extends Car {
    private int num;

    public KeCar() {
    }

    public KeCar(String name, String chepai, int money, boolean chuzu, int num) {
        super(name, chepai, money, chuzu);
        this.num = num;
    }

    @Override
    public double money(int day) {
        if (day >= 3) {
            return getMoney() * day * 0.9;
        }
        if (day >= 7) {
            return getMoney() * day * 0.8;
        }
        if (day >= 30) {
            return getMoney() * day * 0.7;
        }
        if (day >= 150) {
            return getMoney() * day * 0.6;
        }
        return getMoney() * day;
    }

    public void infor() {
        super.infor();
        System.out.print("车类型：客车" + "\t");
        System.out.println("车座位数为：" + num);
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
